package model.expression.command;

import state.TabState;
import state.TurtleState;

public class Random extends AbstractCommandExpression {
	
	public Random(TabState ts) {
		super(ts);
	}
	
	@Override
	protected int getExpNumChildren() {
		return 1;
	}

	@Override
	//TODO: for multiple turtles, the random return the same value
	public int evaluate() {
		int max = this.children.get(0).evaluate();
		return (int) (Math.random() * max);
	}
}
